Skip to content

feat(davinci-client): add form image collector#698

Open
vatsalparikh wants to merge 4 commits into
mainfrom
SDKS-5101
Open

feat(davinci-client): add form image collector#698
vatsalparikh wants to merge 4 commits into
mainfrom
SDKS-5101

Conversation

@vatsalparikh

@vatsalparikh vatsalparikh commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

JIRA Ticket

https://pingidentity.atlassian.net/browse/SDKS-5101

Review Note:

The third commit davinci-client: add image collector e2e test against old env is only added temporarily. Right now, only the old Davinci env has the feature flag DV-21617-forms-image-component-sdk-response enabled. So instead of updating the form to match the old env, I've added a new file form-image.test.ts and added old Davinci config to server-configs.ts file as a separate commit. Will remove this commit as soon as the flag is enabled for new Davinci console.

Description

Adds support for the IMAGE field type in DaVinci forms. When a form includes an image component, the SDK now parses it into an ImageCollector, a read-only collector with description, imageUrl, and hyperlink properties.

How to test

Recording

Screen.Recording.2026-06-22.at.11.52.23.AM.mov

Summary by CodeRabbit

  • New Features

    • Added support for IMAGE form fields in PingOne Forms, enabling rendering of images with optional hyperlinks within form workflows.
  • Tests

    • Added end-to-end test coverage to validate image rendering and hyperlink functionality in forms.

@changeset-bot

changeset-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1873072

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@forgerock/davinci-client Minor
@forgerock/device-client Minor
@forgerock/journey-client Minor
@forgerock/oidc-client Minor
@forgerock/protect Minor
@forgerock/sdk-types Minor
@forgerock/sdk-utilities Minor
@forgerock/iframe-manager Minor
@forgerock/sdk-logger Minor
@forgerock/sdk-oidc Minor
@forgerock/sdk-request-middleware Minor
@forgerock/storage Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@vatsalparikh, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 47 minutes and 59 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6167280a-447f-4f96-991a-b9f1cb1053cf

📥 Commits

Reviewing files that changed from the base of the PR and between 3de5f3a and 1873072.

📒 Files selected for processing (10)
  • .changeset/curly-wolves-swim.md
  • e2e/davinci-app/components/form-image.ts
  • e2e/davinci-suites/src/form-image.test.ts
  • packages/davinci-client/api-report/davinci-client.api.md
  • packages/davinci-client/api-report/davinci-client.types.api.md
  • packages/davinci-client/src/lib/collector.types.test-d.ts
  • packages/davinci-client/src/lib/collector.types.ts
  • packages/davinci-client/src/lib/collector.utils.test.ts
  • packages/davinci-client/src/lib/collector.utils.ts
  • packages/davinci-client/src/lib/node.reducer.test.ts
📝 Walkthrough

Walkthrough

Adds ImageCollector as a new no-value collector type for DaVinci IMAGE form fields. Introduces ImageField and ImageCollector types, a returnImageCollector factory function, a new branch in the node reducer, updated public API reports, an e2e app DOM component (form-image.ts), and a Playwright test.

Changes

ImageCollector Feature

Layer / File(s) Summary
ImageField and ImageCollector type contracts
packages/davinci-client/src/lib/davinci.types.ts, packages/davinci-client/src/lib/collector.types.ts, packages/davinci-client/src/lib/node.types.ts, packages/davinci-client/src/lib/collector.types.test-d.ts, packages/davinci-client/src/lib/node.types.test-d.ts
ImageField type added with type: 'IMAGE', imageUrl, description, and optional hyperlinkUrl; ImageCollector interface added as NoValueCollectorBase<'ImageCollector'> with output.src, output.alt, and optional output.href; ReadOnlyFields, NoValueCollectorTypes, InferNoValueCollectorType, NoValueCollectors, and Collectors unions extended; type-check assertions added.
returnImageCollector factory and node reducer branch
packages/davinci-client/src/lib/collector.utils.ts, packages/davinci-client/src/lib/collector.utils.test.ts, packages/davinci-client/src/lib/node.reducer.ts, packages/davinci-client/src/lib/node.reducer.test.ts
returnImageCollector(field, idx) factory added, mapping imageUrlsrc, descriptionalt/label, conditional hyperlinkUrlhref; returnNoValueCollector hardened with a 'content' in field guard; node/next reducer gains an IMAGE branch; unit tests cover field mapping, href omission, and read-only enforcement.
Public API report updates
packages/davinci-client/api-report/davinci-client.api.md, packages/davinci-client/api-report/davinci-client.types.api.md
Regenerated API reports expose ImageCollector and ImageField; davinci() return union branch ordering reordered; error? type ordering in RTK cache helper signatures normalized to SerializedError | FetchBaseQueryError | undefined.
E2E app image component and form wiring
e2e/davinci-app/components/form-image.ts, e2e/davinci-app/main.ts, e2e/davinci-app/server-configs.ts
New form-image.ts component renders an <img> from ImageCollector.output, optionally wrapped in <a>, or an error paragraph when collector.error is set; renderForm dispatch extended with an ImageCollector branch; new server config entry added for the image feature flag environment.
Playwright e2e tests and changeset
e2e/davinci-suites/src/form-image.test.ts, .changeset/curly-wolves-swim.md
Playwright test asserts form-image element visibility, src regex match, alt, and wrapping anchor href; minor-bump changeset added for @forgerock/davinci-client.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • ForgeRock/ping-javascript-sdk#573: Adds a PhoneNumberExtensionCollector branch to the same renderForm dispatch in e2e/davinci-app/main.ts, the identical integration point extended by this PR for ImageCollector.

Suggested reviewers

  • cerebrl
  • ryanbas21

🐇 A field of type IMAGE appears one day,
With src and alt and href on the way.
The collector hops in, no value to give,
Just pixels and links so the form fields may live.
The rabbit approves — now images display! 🖼️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding form image collector support to davinci-client.
Description check ✅ Passed The description includes a JIRA ticket link, detailed explanation of changes, testing instructions, and a recording; it comprehensively addresses the required template sections.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch SDKS-5101

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 6d4382b

Command Status Duration Result
nx run-many -t build --no-agents ✅ Succeeded <1s View ↗
nx affected -t build lint test typecheck e2e-ci ✅ Succeeded 2m 25s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-06-23 16:05:00 UTC

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@pkg-pr-new

pkg-pr-new Bot commented Jun 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

@forgerock/davinci-client

pnpm add https://pkg.pr.new/@forgerock/davinci-client@698

@forgerock/device-client

pnpm add https://pkg.pr.new/@forgerock/device-client@698

@forgerock/journey-client

pnpm add https://pkg.pr.new/@forgerock/journey-client@698

@forgerock/oidc-client

pnpm add https://pkg.pr.new/@forgerock/oidc-client@698

@forgerock/protect

pnpm add https://pkg.pr.new/@forgerock/protect@698

@forgerock/sdk-types

pnpm add https://pkg.pr.new/@forgerock/sdk-types@698

@forgerock/sdk-utilities

pnpm add https://pkg.pr.new/@forgerock/sdk-utilities@698

@forgerock/iframe-manager

pnpm add https://pkg.pr.new/@forgerock/iframe-manager@698

@forgerock/sdk-logger

pnpm add https://pkg.pr.new/@forgerock/sdk-logger@698

@forgerock/sdk-oidc

pnpm add https://pkg.pr.new/@forgerock/sdk-oidc@698

@forgerock/sdk-request-middleware

pnpm add https://pkg.pr.new/@forgerock/sdk-request-middleware@698

@forgerock/storage

pnpm add https://pkg.pr.new/@forgerock/storage@698

commit: e0cdac0

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Deployed 22fec8c to https://ForgeRock.github.io/ping-javascript-sdk/pr-698/22fec8cd19283d5a19296893e7d9b331b3dc9340 branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🚨 Significant Changes

🔻 @forgerock/device-client - 0.0 KB (-10.0 KB, -100.0%)
🔻 @forgerock/journey-client - 0.0 KB (-93.0 KB, -100.0%)

📊 Minor Changes

📈 @forgerock/davinci-client - 54.4 KB (+0.6 KB)
📉 @forgerock/device-client - 10.0 KB (-0.0 KB)

➖ No Changes

@forgerock/oidc-client - 35.2 KB
@forgerock/sdk-types - 7.9 KB
@forgerock/sdk-utilities - 11.9 KB
@forgerock/journey-client - 93.0 KB
@forgerock/protect - 144.6 KB
@forgerock/iframe-manager - 3.2 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/storage - 1.5 KB
@forgerock/sdk-request-middleware - 4.6 KB
@forgerock/sdk-oidc - 5.7 KB


14 packages analyzed • Baseline from latest main build

Legend

🆕 New package
🔺 Size increased
🔻 Size decreased
➖ No change

ℹ️ How bundle sizes are calculated
  • Current Size: Total gzipped size of all files in the package's dist directory
  • Baseline: Comparison against the latest build from the main branch
  • Files included: All build outputs except source maps and TypeScript build cache
  • Exclusions: .map, .tsbuildinfo, and .d.ts.map files

🔄 Updated automatically on each push to this PR

@codecov-commenter

codecov-commenter commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 22.02%. Comparing base (eafe277) to head (e0cdac0).
⚠️ Report is 32 commits behind head on main.

❌ Your project status has failed because the head coverage (22.02%) is below the target coverage (40.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #698      +/-   ##
==========================================
+ Coverage   18.07%   22.02%   +3.95%     
==========================================
  Files         155      157       +2     
  Lines       24398    25205     +807     
  Branches     1203     1479     +276     
==========================================
+ Hits         4410     5552    +1142     
+ Misses      19988    19653     -335     
Files with missing lines Coverage Δ
packages/davinci-client/src/lib/collector.types.ts 100.00% <ø> (ø)
packages/davinci-client/src/lib/collector.utils.ts 86.34% <100.00%> (+1.19%) ⬆️
packages/davinci-client/src/lib/davinci.types.ts 100.00% <ø> (ø)
packages/davinci-client/src/lib/node.reducer.ts 71.72% <100.00%> (+1.24%) ⬆️
packages/davinci-client/src/lib/node.types.ts 100.00% <ø> (ø)

... and 15 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vatsalparikh vatsalparikh marked this pull request as ready for review June 22, 2026 19:00

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
packages/davinci-client/src/lib/collector.types.test-d.ts (1)

658-672: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Add a companion type test without hyperlinkUrl to lock optional semantics.

Current coverage validates the “present” case only. Adding a second ImageCollector sample without hyperlinkUrl would protect against accidentally making it required later.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/davinci-client/src/lib/collector.types.test-d.ts` around lines 658 -
672, Add a second type test case for ImageCollector that omits the hyperlinkUrl
property from the output object. Create a new test (likely another it block)
that validates the InferNoValueCollectorType type inference for ImageCollector
but with a minimal output structure that excludes hyperlinkUrl, ensuring the
type definition correctly treats hyperlinkUrl as optional and prevents
accidental breaking changes that might make it required.
packages/davinci-client/src/lib/collector.types.ts (1)

640-649: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Align ImageCollector docs with the declared required description field.

The JSDoc says description is optional, but output.description is typed as required (string). Please make the comment consistent with the type contract.

Suggested doc-only fix
- * hyperlink URL (`hyperlink.url`), and an optional `description` (alt text).
+ * hyperlink URL (`hyperlink.url`), and `description` (alt text).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/davinci-client/src/lib/collector.types.ts` around lines 640 - 649,
The JSDoc comment for the `ImageCollector` interface incorrectly describes
`description` as an optional field when the type definition shows `description:
string` as required (non-nullable). Update the comment above the
`ImageCollector` interface to remove the "optional" designation for
`description` and accurately reflect that it is a required field in the output
type, while keeping the reference to it being alt text.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/davinci-suites/src/form-image.test.ts`:
- Around line 22-25: The test assertion for the formImage src attribute uses a
brittle full URL equality check that will fail if query parameters, their order,
or optimization values change. Instead of checking the entire URL with
toHaveAttribute, use a more flexible assertion that checks if the src contains
or matches just the essential parts of the URL (such as the base image path from
destinationcanada.com without the query parameters) to make the test more
resilient to parameter changes.

---

Nitpick comments:
In `@packages/davinci-client/src/lib/collector.types.test-d.ts`:
- Around line 658-672: Add a second type test case for ImageCollector that omits
the hyperlinkUrl property from the output object. Create a new test (likely
another it block) that validates the InferNoValueCollectorType type inference
for ImageCollector but with a minimal output structure that excludes
hyperlinkUrl, ensuring the type definition correctly treats hyperlinkUrl as
optional and prevents accidental breaking changes that might make it required.

In `@packages/davinci-client/src/lib/collector.types.ts`:
- Around line 640-649: The JSDoc comment for the `ImageCollector` interface
incorrectly describes `description` as an optional field when the type
definition shows `description: string` as required (non-nullable). Update the
comment above the `ImageCollector` interface to remove the "optional"
designation for `description` and accurately reflect that it is a required field
in the output type, while keeping the reference to it being alt text.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d0ed34c7-4971-4ef6-b40c-f2162503f81c

📥 Commits

Reviewing files that changed from the base of the PR and between 35816b4 and b0d790d.

📒 Files selected for processing (17)
  • .changeset/curly-wolves-swim.md
  • e2e/davinci-app/components/form-image.ts
  • e2e/davinci-app/main.ts
  • e2e/davinci-app/server-configs.ts
  • e2e/davinci-suites/src/form-fields.test.ts
  • e2e/davinci-suites/src/form-image.test.ts
  • packages/davinci-client/api-report/davinci-client.api.md
  • packages/davinci-client/api-report/davinci-client.types.api.md
  • packages/davinci-client/src/lib/collector.types.test-d.ts
  • packages/davinci-client/src/lib/collector.types.ts
  • packages/davinci-client/src/lib/collector.utils.test.ts
  • packages/davinci-client/src/lib/collector.utils.ts
  • packages/davinci-client/src/lib/davinci.types.ts
  • packages/davinci-client/src/lib/node.reducer.test.ts
  • packages/davinci-client/src/lib/node.reducer.ts
  • packages/davinci-client/src/lib/node.types.test-d.ts
  • packages/davinci-client/src/lib/node.types.ts

Comment thread e2e/davinci-suites/src/form-image.test.ts Outdated

@cerebrl cerebrl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to simplify the property names, but otherwise, looks good.

Comment on lines +647 to +649
imageUrl: string;
description: string;
hyperlinkUrl?: string;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to avoid compound property names, if possible. How do you feel about borrowing from HTML here and just use src, instead of imageUrl and href, instead of hyperlinkUrl?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to keep the parity with what we receive from Davinci, but totally open to using simpler names. This is what we receive from Davinci

   "type": "IMAGE",
   "key": "<field key>",
   "description": "<alt text>",
   "imageUrl": "<absolute URL>",
   "hyperlinkUrl": "<absolute URL>"

Do you have a preference there? I feel it's easier to reason through and debug when we keep the same properties as what Davinci returns. Besides, I checked and almost all collectors except for QrCodeField follow property names the same as what Davinci returns.

I can change it to alt, src, href. However, would be good to know your opinion on whether we should keep that parity or borrow from HTML.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this further. davinci.types.ts already maps what Davinci returns, so we can rename those properties independently from Davinci in collector.types.ts file. Updated the description, imageUrl, hyperlinkUrl properties to alt, src, href respectively.

@ancheetah ancheetah left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, some minor comments and suggestions

Comment thread .changeset/curly-wolves-swim.md Outdated
Comment thread e2e/davinci-app/server-configs.ts
output: {
key: `${field.key || field.type}-${idx}`,
label: field.content,
label: 'content' in field ? field.content : '',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about copying field.description here into label so it's not empty?

@vatsalparikh vatsalparikh Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you mean, something like field.content ?? field.description ?? ''

Among the NoValueCollectors, description is used only by ImageCollector. We can put that as a label, but it seems like we're adding an image collector specific property to a generic NoValueCollector.

However, if we were to extend no value collector for other fields later and if we find that description is an alternative property to content, maybe we can add it there then.

Right now, I feel like it might cause future bugs where NoValueCollector now checks for description if content is null, which is something specific to only image collector, and description may not be a property or description might mean something else for other no value collectors that we add later.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we only override the label property in the returnImageCollector function?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that sounds interesting. I'm thinking this will change the naming for alt to label. I do like the idea that we can reuse an existing field but at the same time if we prefer HTML specific names like src, alt, href, like Justin mentioned in the earlier comment, then it kind of deviates in terms of naming.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't have to change the alt naming necessarily. The value of field.description could be placed into both alt and label. We do something similar in NoValueCollectors where we sometimes put field.content into both output.label and output.content. I think having some value for label instead of leaving it blank keeps it consistent with other collectors from this category and avoids having a "dead" property.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay. I can do that and continue to use alt. That is perfect, if that is what you are referring to. Just pushed the commit!

@ancheetah

Copy link
Copy Markdown
Collaborator

@vatsalparikh One more question, should this have a do not merge label so that it doesn't go out in 2.1 release?

@vatsalparikh

Copy link
Copy Markdown
Contributor Author

@vatsalparikh One more question, should this have a do not merge label so that it doesn't go out in 2.1 release?

Is there a reason to hold back ImageCollector feature in 2.1 release?

@ancheetah

Copy link
Copy Markdown
Collaborator

@vatsalparikh One more question, should this have a do not merge label so that it doesn't go out in 2.1 release?

Is there a reason to hold back ImageCollector feature in 2.1 release?

I'm not sure. It's a question for product wether or not it should go out. I would think if we are starting QA, we should be in code freeze.

@vatsalparikh vatsalparikh force-pushed the SDKS-5101 branch 2 times, most recently from 0f1d875 to 6d4382b Compare June 23, 2026 15:51

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud is proposing a fix for your failed CI:

We reverted the waitForRequest URL filter in form-fields.test.ts from showForm back to customForm, as the DaVinci API's form submission POST request URL contains customForm, not showForm. The showForm filter caused the waitForRequest promise to never resolve, resulting in a 30-second timeout. This fix restores the correct URL matching so the test can proceed after the Submit button is clicked.

Tip

We verified this fix by re-running @forgerock/davinci-suites:e2e-ci--src/form-fields.test.ts.

diff --git a/e2e/davinci-suites/src/form-fields.test.ts b/e2e/davinci-suites/src/form-fields.test.ts
index 101a3e9..c58d792 100644
--- a/e2e/davinci-suites/src/form-fields.test.ts
+++ b/e2e/davinci-suites/src/form-fields.test.ts
@@ -71,7 +71,7 @@ test('Should render form fields', async ({ page }) => {
   await expect(page.getByRole('button', { name: 'Flow Link' })).toBeVisible();
 
   const requestPromise = page.waitForRequest(
-    (request) => request.url().includes('showForm') && request.method() === 'POST',
+    (request) => request.url().includes('customForm') && request.method() === 'POST',
   );
 
   await page.getByRole('button', { name: 'Submit' }).click();

Apply fix via Nx Cloud  Reject fix via Nx Cloud


Or Apply changes locally with:

npx nx-cloud apply-locally rp64-yw5H

Apply fix locally with your editor ↗   View interactive diff ↗



🎓 Learn more about Self-Healing CI on nx.dev

@vatsalparikh vatsalparikh force-pushed the SDKS-5101 branch 2 times, most recently from e0cdac0 to 3de5f3a Compare June 23, 2026 22:42

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/davinci-client/src/lib/collector.utils.ts`:
- Line 1009: The `alt` property assignment on line 1009 uses `field.description`
directly without a fallback value, while the `label` property on line 1007 uses
`field.description ?? ''` to provide an empty string default. This inconsistency
means `alt` will be `undefined` when `field.description` is missing, while
`label` will be an empty string. Apply the same defensive null coalescing
pattern to the `alt` assignment to use an empty string fallback when
`field.description` is absent, ensuring consistent behavior between both
properties.
- Line 1008: The `src` property assignment using `field.imageUrl` lacks a
fallback mechanism for when imageUrl is null or undefined, resulting in invalid
src attributes. Add a fallback value to the `src: field.imageUrl` assignment by
using the pattern `src: field.imageUrl || ''` to match the approach used in the
`returnQrCodeCollector` function, ensuring the image element always has a valid
(even if empty) src attribute.
- Line 1004: The returnImageCollector function explicitly sets error: null,
which overrides validation errors from the base returnNoValueCollector, creating
inconsistency with other collectors like returnQrCodeCollector and
returnReadOnlyCollector that inherit the base error state. Either remove the
explicit error: null assignment from returnImageCollector to inherit the base
validation behavior like the other collectors do, or keep it and add a clear
comment documenting why IMAGE collectors specifically need to bypass validation
error checking while other collectors do not.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b30cfd02-44b0-47b4-bd27-24e01a2e20d8

📥 Commits

Reviewing files that changed from the base of the PR and between 0f1d875 and 3de5f3a.

📒 Files selected for processing (10)
  • .changeset/curly-wolves-swim.md
  • e2e/davinci-app/components/form-image.ts
  • e2e/davinci-suites/src/form-image.test.ts
  • packages/davinci-client/api-report/davinci-client.api.md
  • packages/davinci-client/api-report/davinci-client.types.api.md
  • packages/davinci-client/src/lib/collector.types.test-d.ts
  • packages/davinci-client/src/lib/collector.types.ts
  • packages/davinci-client/src/lib/collector.utils.test.ts
  • packages/davinci-client/src/lib/collector.utils.ts
  • packages/davinci-client/src/lib/node.reducer.test.ts
✅ Files skipped from review due to trivial changes (1)
  • .changeset/curly-wolves-swim.md
🚧 Files skipped from review as they are similar to previous changes (8)
  • packages/davinci-client/src/lib/collector.types.test-d.ts
  • e2e/davinci-suites/src/form-image.test.ts
  • packages/davinci-client/src/lib/node.reducer.test.ts
  • e2e/davinci-app/components/form-image.ts
  • packages/davinci-client/src/lib/collector.types.ts
  • packages/davinci-client/src/lib/collector.utils.test.ts
  • packages/davinci-client/api-report/davinci-client.api.md
  • packages/davinci-client/api-report/davinci-client.types.api.md


return {
...base,
error: null,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Compare error handling across collector factory functions

# Check if other collectors override the error property
rg -A 10 'export function return.*Collector' packages/davinci-client/src/lib/collector.utils.ts | rg -C 2 'error:'

Repository: ForgeRock/ping-javascript-sdk

Length of output: 432


🏁 Script executed:

#!/bin/bash
# Read the area around line 1004 to identify which collector this is
sed -n '990,1020p' packages/davinci-client/src/lib/collector.utils.ts

Repository: ForgeRock/ping-javascript-sdk

Length of output: 1413


🏁 Script executed:

#!/bin/bash
# Search for returnQrCodeCollector and returnReadOnlyCollector functions and their error handling
rg -B 5 -A 15 'export function returnQrCodeCollector|export function returnReadOnlyCollector' packages/davinci-client/src/lib/collector.utils.ts

Repository: ForgeRock/ping-javascript-sdk

Length of output: 1675


🏁 Script executed:

#!/bin/bash
# Get a complete view of all collector factory functions and their error property handling
ast-grep outline packages/davinci-client/src/lib/collector.utils.ts | head -50

Repository: ForgeRock/ping-javascript-sdk

Length of output: 2341


🏁 Script executed:

#!/bin/bash
# Find and read the returnNoValueCollector implementation
sed -n '905,939p' packages/davinci-client/src/lib/collector.utils.ts

Repository: ForgeRock/ping-javascript-sdk

Length of output: 1435


Remove explicit error: null override or document why IMAGE collectors bypass validation errors.

returnImageCollector explicitly sets error: null, overriding validation from the base returnNoValueCollector. In contrast, returnQrCodeCollector and returnReadOnlyCollector inherit the base error state, which validates that content and type fields exist.

Either IMAGE collectors should inherit the base validation (removing the explicit null), or this difference should be documented with a comment explaining why IMAGE collectors skip error validation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/davinci-client/src/lib/collector.utils.ts` at line 1004, The
returnImageCollector function explicitly sets error: null, which overrides
validation errors from the base returnNoValueCollector, creating inconsistency
with other collectors like returnQrCodeCollector and returnReadOnlyCollector
that inherit the base error state. Either remove the explicit error: null
assignment from returnImageCollector to inherit the base validation behavior
like the other collectors do, or keep it and add a clear comment documenting why
IMAGE collectors specifically need to bypass validation error checking while
other collectors do not.

output: {
...base.output,
label: field.description ?? '',
src: field.imageUrl,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Consider adding fallback for src to handle missing imageUrl.

The src property is set directly from field.imageUrl without a fallback. If imageUrl is null or undefined, the resulting image element will have an invalid src attribute. For comparison, returnQrCodeCollector (line 983) uses field.content || '' to provide a fallback for its src property.

🛡️ Proposed fix to add fallback for src
      label: field.description ?? '',
-      src: field.imageUrl,
+      src: field.imageUrl ?? '',
      alt: field.description,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
src: field.imageUrl,
label: field.description ?? '',
src: field.imageUrl ?? '',
alt: field.description,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/davinci-client/src/lib/collector.utils.ts` at line 1008, The `src`
property assignment using `field.imageUrl` lacks a fallback mechanism for when
imageUrl is null or undefined, resulting in invalid src attributes. Add a
fallback value to the `src: field.imageUrl` assignment by using the pattern
`src: field.imageUrl || ''` to match the approach used in the
`returnQrCodeCollector` function, ensuring the image element always has a valid
(even if empty) src attribute.

...base.output,
label: field.description ?? '',
src: field.imageUrl,
alt: field.description,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Add fallback for alt to match label handling.

The alt property uses field.description directly without a fallback, while label on line 1007 uses field.description ?? ''. This inconsistency means that when field.description is absent, label will be an empty string but alt will be undefined. Based on the unit tests (which verify label defaults to '' when description is missing), the same defensive handling should apply to alt.

🛡️ Proposed fix to add fallback for alt
      label: field.description ?? '',
      src: field.imageUrl,
-      alt: field.description,
+      alt: field.description ?? '',
      ...(field.hyperlinkUrl ? { href: field.hyperlinkUrl } : {}),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
alt: field.description,
label: field.description ?? '',
src: field.imageUrl,
alt: field.description ?? '',
...(field.hyperlinkUrl ? { href: field.hyperlinkUrl } : {}),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/davinci-client/src/lib/collector.utils.ts` at line 1009, The `alt`
property assignment on line 1009 uses `field.description` directly without a
fallback value, while the `label` property on line 1007 uses `field.description
?? ''` to provide an empty string default. This inconsistency means `alt` will
be `undefined` when `field.description` is missing, while `label` will be an
empty string. Apply the same defensive null coalescing pattern to the `alt`
assignment to use an empty string fallback when `field.description` is absent,
ensuring consistent behavior between both properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants